import type {PageParam, PageResult} from '@vben/request';
import type {Dayjs} from 'dayjs';

import {requestClient} from '#/api/request';
export namespace PerLaborIncomeApi {
  /** 劳务所得情况信息 */
  export interface LaborIncome {
    id: number; // 主键ID
    employeeId?: number; // 人员ID，对应 per_employee.id
    lectureFee: number; // 讲学收入
    writingFee: number; // 写作收入
    consultingFee: number; // 咨询收入
    reviewFee: number; // 审稿收入
    paintingFee: number; // 书画收入
    otherFee: number; // 其他收入
    totalAmount: number; // 合计收入
    year: string; // 年度
    status: number; // 状态（1：有效，0：无效）
  }
}

/** 查询劳务所得情况分页 */
export function getLaborIncomePage(data: PageParam,desensitize: boolean,encrypt: boolean) {
  return requestClient.post<PageResult<PerLaborIncomeApi.LaborIncome>>('/per/labor-income/page', data,{ desensitize,encrypt });
}

/** 查询劳务所得情况详情 */
export function getLaborIncome(id: number) {
  return requestClient.get<PerLaborIncomeApi.LaborIncome>(`/per/labor-income/get?id=${id}`);
}

/** 新增劳务所得情况 */
export function createLaborIncome(data: PerLaborIncomeApi.LaborIncome) {
  return requestClient.post('/per/labor-income/create', data);
}

/** 修改劳务所得情况 */
export function updateLaborIncome(data: PerLaborIncomeApi.LaborIncome) {
  return requestClient.put('/per/labor-income/update', data);
}

/** 删除劳务所得情况 */
export function deleteLaborIncome(id: number) {
  return requestClient.delete(`/per/labor-income/delete?id=${id}`);
}

/** 批量删除劳务所得情况 */
export function deleteLaborIncomeList(ids: number[]) {
  return requestClient.delete(`/per/labor-income/delete-list?ids=${ids.join(',')}`)
}

/** 导出劳务所得情况 */
export function exportLaborIncome(params: any) {
  return requestClient.download('/per/labor-income/export-excel', { params });
}
